package com.io.InputStream;

import com.sun.xml.internal.messaging.saaj.util.ByteOutputStream;

import java.io.*;

/**
 * Created by mike on 17/5/21.
 */
public class ImputStreamTest {
    public static void main(String[] args) throws Exception {

        InputStream inputStream = new ByteArrayInputStream("fdsafds".getBytes());
        byte[] bytes = new byte[inputStream.available()];
        inputStream.read(bytes);
        System.out.println(new String(bytes));

        byte[] bytes1 = new byte[1024];
        ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
        outputStream.write("ffff".getBytes());
        System.out.println(outputStream.toString());
    }
}